# example data
for index, row in id_rms_df.iterrows():
fig, ax = plt.subplots(figsize=(12,5))
# the histogram of the data
n, bins, patches = ax.hist(row['rms'], num_bins, density=1, edgecolor='black', linewidth=1.5)
bin_centers = 0.5 * (bins[1:] + bins[:-1])
ax.plot(bin_centers, n, color='red') ## using bin_centers rather than edges
ax.set_xticks(x_x)
ax.set_yticks(y_y)
ax.set_xlabel(' -- RMSD -- ')
ax.set_ylabel(' -- Frequency -- ')
ax.text(2.3, 41, 'Fragment: ' + amino_codes[row['seq1'][:3]] + '-' + amino_codes[row['seq1'][3:6]] + '-' + amino_codes[row['seq1'][6:10]], style='italic',
bbox={'facecolor':'red', 'alpha': 0.5, 'pad':10})
ax.text(2.3, 34, 'Count: ' + str(skew(row['rms']))[:8], style='italic',
bbox={'facecolor':'yellow', 'alpha': 0.5, 'pad':10})
ax.text(2.3, 27, 'Skew: ' + str(skew(row['rms']))[:8], style='italic',
bbox={'facecolor':'yellow', 'alpha': 0.5, 'pad':10})
ax.text(2.3, 20, 'Kurtosis: ' + str(kurtosis(row['rms']))[:8], style='italic',
bbox={'facecolor':'lightblue', 'alpha': 0.5, 'pad':10})
# Tweak spacing to prevent clipping of ylabel
plt.show()